package cn.topcodes.tcsf.admin.service.impl;

import cn.topcodes.tcsf.admin.mapper.SecurityMapper;
import cn.topcodes.tcsf.admin.service.security.Resource;
import cn.topcodes.tcsf.admin.service.security.SecurityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by Unicorn on 2017/9/28.
 */
@Service
@Transactional(readOnly = true)
public class SecurityServiceImpl implements SecurityService {

    @Autowired
    private SecurityMapper securityMapper;

    @Override
    public List<String> getRoleCodeByUserId(long userId) {
        return this.securityMapper.getRoleCodeByUserId(userId);
    }

    @Override
    public List<String> getPermCodeByUserId(long userId) {
        return this.securityMapper.getPermCodeByUserId(userId);
    }

    @Override
    public List<Resource> findPermDef() {
        return this.securityMapper.findPermDef();
    }
}
